﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using App.Authorization.Users;
using App.BaseObject;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace App.Organizations
{
    /// <summary>
    /// 组织架构
    /// </summary>
    public class OrganizationUnit : AuditedEntity, IMayHaveTenant
    {
        public virtual int? ParentId { get; set; }
        [StringLength(ColumnSetting.Short)]
        public virtual string TeamName { get; set; }
        [StringLength(ColumnSetting.Remark)]
        public virtual string TeamDesc { get; set; }
        public virtual int SortOrder { get; set; }
        [ForeignKey("ParentId")]
        public virtual ICollection<OrganizationUnit> ChildTeams { get; set; }
        public virtual ICollection<User> Users { get; set; }
        public virtual int? TenantId { get; set; }
    }
}
